@extends('layouts.default')

@section('title', '教师签到')

@push('scripts')
<script>
    layui.use(['form','laytpl'], function(){
        var form = layui.form;
        var laytpl = layui.laytpl;
        var pageId = "{{request()->get('id',0)}}";
        
        form.on('submit(formDemo)', function(data){
            var d = data.field;
            d.activity_id = pageId;

            addActivitySign(data.field,function(res){
                if(res.code == '1'){
                    layer.msg(res.msg,{icon: 6,time: 1000},function(){
                        
                    });
                }else{
                    layer.msg(res.msg, {icon: 5,shift : 6});
                }
            })

            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>

@endpush

@section('content')
<style>
    body{font-size: 16px;}
    .pear-container{margin: 0px;}
    .layui-container {padding: 0px;}
    .title{background-color: #74b8ff; height: 50px;line-height: 50px;text-align: center;color: #fff;}
    .layui-input, .layui-textarea {width: 85%;}
</style>

<div class="layui-container">  
    <div class="layui-row">
        <div class="layui-col-md12 title"> 签到 </div>
        <div class="layui-col-md12" style="margin-top:100px;" >
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">教师账号:</label>
                    <div class="layui-input-block">
                        <input type="text" name="user_id" required  lay-verify="required" placeholder="请输入教师账号" lay-reqText="教师账号不能为空" autocomplete="off" class="layui-input">
                    </div>
                </div>
            
                <div class="layui-form-item">
                    <div class="layui-input-block" style="text-align: center;margin-left: 0px;">
                        <button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">签到</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection